//统一管理首页模块接口
import request from "@/utils/request.ts";
//引入ts类型
import type {HospitalResponseData,HospitalLevelAndRegionResponseData,HospitalInfo} from "@/api/home/type.ts";

//通过枚举管理首页模块的接口地址
enum API {
    //获取已有的一员数据结构地址
    HOSPITAL_URL= "/hosp/hospital/",
    //获取医院等级与地区接口
    HOSPITALLEVELANDREGION_URL = "/cmn/dict/findByDictCode/",
    //根据关键字获取医院的数据
    HOSPITALINFO_URL = "/hosp/hospital/findByHosname/",
};

//医院数据
export const reqHospital = (page:number,limit:number,hostype="",districtCode="")=>
    request.get<any,HospitalResponseData>(API.HOSPITAL_URL+`${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`);
//医院等级或医院地区
export const reqHospitalLevelAndRegion = (dicCode: string) => request.get<any,HospitalLevelAndRegionResponseData>(API.HOSPITALLEVELANDREGION_URL + dicCode);
//根据关键字获取医院数据
export const reqHospitalInfo = (hosname:string) => request.get<any,HospitalInfo>(API.HOSPITALINFO_URL+hosname);
